import store from "../../store";
import {connect} from "react-redux"
// 认识状态
// dispatch：更改状态
// subscribe：订阅状态更改
function HelloStore(props) {
    
    return (
        <div>
            <h2>connect</h2>
            <p>{props.count}</p>
            <button onClick={() => store.dispatch({ type: 'INCREMENT' })}>+</button>
            <button onClick={() => store.dispatch({ type: 'DECREMENT' })}>-</button>
        </div>
    )

}
const mapMutations=(state,ownProps)=>{
    return {
        count:state 
    }
       
    
}

export default connect(mapMutations)(HelloStore)